;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2021 konkrotte <konkrotte@posteo.net>
;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages croc)
  #:use-module (guix build-system go)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (gnu packages golang)
  #:use-module (gnu packages syncthing)
  #:use-module ((guixrus packages common go) #:prefix rus:))

(define-public croc
  (package
    (name "croc")
    (version "9.5.2")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/schollz/croc")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1ynx3wck0820z0a2m976xbvnzq83kr9cxpl08i13qi7jnrz3ibqx"))))
    (build-system go-build-system)
    (arguments
     (list #:import-path "github.com/schollz/croc/v9"
           #:install-source? #f
           #:phases
           #~(modify-phases %standard-phases
               (replace 'install
                 (lambda* (#:key outputs #:allow-other-keys)
                   (let ((out (assoc-ref outputs "out")))
                     (invoke "mv"
                             (string-append out "/bin/v9")
                             (string-append out "/bin/croc"))))))))
    (inputs
     (list go-gopkg-in-yaml-v3
           go-gopkg-in-check-v1
           go-golang-org-x-crypto
           go-golang-org-x-net
           go-golang-org-x-sys
           go-golang-org-x-term
           go-golang-org-x-text
           go-golang-org-x-time
           go-github-com-twmb-murmur3
           go-github-com-spaolacci-murmur3
           go-github-com-russross-blackfriday
           go-github-com-rivo-uniseg
           go-github-com-pmezard-go-difflib
           go-github-com-mattn-go-runewidth
           go-github-com-kr-pretty
           go-github-com-davecgh-go-spew
           go-github-com-oneofone-xxhash
           go-github-com-stretchr-testify
           go-github-com-cespare-xxhash
           rus:go-github-com-mitchellh-colorstring
           rus:go-github-com-tscholl2-siec
           rus:go-github-com-cpuguy83-go-md2man-v2
           rus:go-github-com-kalafut-imohash
           rus:go-github-com-denisbrodbeck-machineid
           rus:go-github-com-schollz-progressbar-v3
           rus:go-github-com-schollz-peerdiscovery
           rus:go-github-com-schollz-pake-v3
           rus:go-github-com-schollz-mnemonicode
           rus:go-github-com-schollz-logger
           rus:go-github-com-schollz-cli-v2))
    (home-page "https://github.com/schollz/croc")
    (synopsis "Easily and securely send things from one computer to another")
    (description
"@code{croc} is a tool that allows any two computers to simply and
securely transfer files and folders.")
    (license license:expat)))
